﻿using Common.DTO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Database.Mappers
{
    public partial class Mapper
    {
        public CharacterItemDTO Map(CharacterItem characterItems)
        {
            return new CharacterItemDTO
            {
                Id = characterItems.Id,
                ItemType = Map(characterItems.ItemType),
            };
        }

        public CharacterItem Map(CharacterItemDTO characterItems)
        {
            return new CharacterItem
            {
                Id = characterItems.Id,
                ItemType = Map(characterItems.ItemType),
            };
        }

        public List<CharacterItem> Map(List<CharacterItemDTO> characterItems)
        {
            var list = new List<CharacterItem>();
            foreach (var item in characterItems)
            {
                list.Add(Map(item));
            }

            return list;
        }
    }
}
